package collection;

/**
 * Created by 5406160@qq.com on LiBoWen 李博闻.
 *
 * @ClassName : CollectionDemo
 * @Author : 54061
 * @Date: 2022/2/12 14:07
 */
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashSet;
import java.util.Iterator;

public class CollectionDemo {
    public static void main(String[] args) {
        //创建Collection集合
        Collection<String> col = new ArrayList<>();
        System.out.println("col = " + col);//展示集合中元素的内容
        col.add("Hello");
        col.add("Hello");
        col.add("Java");
        System.out.println("col = " + col);//展示集合中元素的内容
        Collection<String> col1 = new HashSet<>();
        System.out.println("col1 = " + col1);
        col1.add("Hello");
        col1.add("Hello");
        col1.add("Java");
        System.out.println("col1 = " + col1);
    }
}
